!
router ospf {{ global.ospf_pid }}
 address-family ipv4 unicast
 area 0
  interface Loopback0
   passive enable
  !
{% for intf in p2p_ip[inventory_hostname] | sort(attribute='port') %}
  interface {{intf.port.split('.')[0]}}
   cost {{intf.cost | default(100)}}
   network point-to-point
  !
{% endfor %}
 !
 mpls traffic-eng router-id Loopback0
!
router bgp {{bgp_asn}}
{% if 'inet' in bgp_topo.af %}
 address-family ipv4 unicast
{% endif %}
 !
{% if 'inet-vpn' in bgp_topo.af %}
 address-family vpnv4 unicast
{% endif %}
 !
{% for peer in bgp_peers %}
 neighbor {{peer.peer}}
  remote-as {{peer.remote_as}}
  local address {{lo_ip[inventory_hostname] | ipaddr('address')}}
{%  if 'inet' in bgp_topo.af  %}
  address-family ipv4 unicast
{%  endif %}
  !
{%  if 'inet-vpn' in bgp_topo.af %}
  address-family vpnv4 unicast
{%  endif %}
  !
{% endfor %}
 !
!
rsvp
{% for intf in p2p_ip[inventory_hostname] | sort(attribute='port') %}
 interface {{intf.port.split('.')[0]}}
{% endfor %}
 !
!
mpls traffic-eng
{% for intf in p2p_ip[inventory_hostname] | sort(attribute='port') %}
 interface {{intf.port.split('.')[0]}}
{% endfor %}
!
mpls ldp
{% for intf in p2p_ip[inventory_hostname] | sort(attribute='port') %}
 interface {{intf.port.split('.')[0]}}
{% endfor %}
!